package Ex1;

	//자릿수 구분문자 _
	// 정수리터럴이 너무 길면 가독성에 문제가 있으므로 JDK7에서 새롭게 추가된 기능이다. (3자릿수 마다 _를 사용할수 있게한것)

public class Ex06_OOP {

	public static void main (String args[]){
	
	Rectangle r = new Rectangle();
	Fan f = new Fan();
	Account a = new Account();
	Stock s = new Stock();

	r.width = 40;
	r.height=4;
	r.color ="red";
	System.out.println(r.width);
	System.out.println(r.height);	
	System.out.println(r.color);
	
	r.width=3.5F;
	r.height=35.9F;
	r.color="orange";
	System.out.println(r.width);
	System.out.println(r.height);	
	System.out.println(r.color);
	
	
	f.radius=10;
	f.color="yellow";
	f.on=true;
	f.speed=f.Fast;
	System.out.println(f.radius);
	System.out.println(f.color);
	System.out.println(f.on);
	System.out.println(f.speed);
	Fan f1 = new Fan();
	
	f1.radius=5;
	f1.on=false;
	f1.speed=f.Medium;
	System.out.println(f1.radius);
	System.out.println(f1.color);
	System.out.println(f1.on);
	System.out.println(f1.speed);
	
	a.aid=1122;
	a.balance=20000;
	a.interestRate = 5.5F;
	a.dateCreated="2013-11-06 13:15:45";
	System.out.println(a.aid);
	System.out.println(a.balance);
	System.out.println(a.interestRate);
	System.out.println(a.dateCreated);
	
	
	s.sname="경영기술";
	s.previousCloosingPirce=1_000_000;
	s.currentPrice=750_000;
	System.out.println(s.sname);
	System.out.println(s.previousCloosingPirce);
	System.out.println(s.currentPrice);
	
	
	}

	
	
}

	class Rectangle{
		
		float width =1.0F; 
		float height =1.0F; 
		String color = "white"; 
		float getArea = (width*height)/2;
		float getPerimeter = (width*height)*2;
	}
	
	class Fan{
		
		final int Slow = 1;
		final int Medium = 2;
		final int Fast=3;
		
		int speed = Slow;
		boolean on = false;
		float radius = 5.0F;
		String color = "blue";
		
		}
	
	class Account{
		
		int aid = 0;
		int balance = 0;
		float interestRate = 0;
		String dateCreated;
		
	}
	
	class Stock{
		
		String sname;
		int previousCloosingPirce;
		int currentPrice;
		
		
	}